This invention relates to performing range reduction on values representing angles in integrated circuit devices, and particularly in programmable integrated circuit devices such as programmable logic devices (PLDs).
Trigonometric functions are generally defined for the relatively small angular range of 0-360°, or 0-2π radians. For angular values above 2π, the values of the trigonometric functions repeat. Indeed, one could restrict the range to 0-π/2, because various trigonometric identities can be used to derive values for trigonometric functions of any angle between π/2 and 2π from trigonometric functions of angles between 0 and π/2.
When determining the trigonometric function of a floating-point value (e.g., a value represented in accordance with the IEEE754-1985 standard for floating-point arithmetic), one of the first steps is to reduce the value to the range 0-2π (i.e., for a value x, to determine y=mod(x, 2π)).
Theoretically, one can calculate y=x−((int(x/2π))×2π). However, such a calculation is expensive in hardware, such as in programmable integrated circuit devices. For example, if x is large, int(x/2π) also will be large, and therefore memory must be provided for storing very large, very high precision numbers (i.e., numbers of higher precision than the 23 bits called for by the aforementioned IEEE754-1985 standard). In addition, the larger the value of x, the more iterations in the calculation.